#include <bits/stdc++.h>

using namespace std;
#define int long long
const int inf = 0x3f3f3f3f;

void solve()
{
	int n;
	cin >> n;
	int odd = 0, even = 0, ma = -1;
	int sum = 0;
	for (int i = 0; i < n; i++)
	{
		int x;
		cin >> x;
		ma = max(ma, x);
		sum += x;
		if (x & 1) odd++;
		else even++;
	}
	if (odd == 0 || even == 0) cout << ma << '\n';
	else cout << sum - odd + 1 << '\n';
}

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int _ = 1;
	cin >> _;
	while (_--)
	{
		solve();
	}
	return 0;
}